package com.example.hello;

import javax.servlet.ServletException;
import java.io.*;
import javax.servlet.http.*;

public class HelloServlet extends HttpServlet
{
	//重写了父类HttpServlet中的doGet()方法，用于对GET请求方法做出响应
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
               throws ServletException,IOException
    {
         PrintWriter out = resp.getWriter();  //得到PrintWriter对象
         out.println("Hello Servlet");  //向客户端发送字符数据
         out.close(); 
    }
}
